package com.hongyuan.coach.ui.course.view_mode;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;
import com.hongyuan.mvvmhabitx.binding.command.BindingCommand;
import com.hongyuan.coach.base.CustomViewModel;
import com.hongyuan.coach.base.ItemViewModel;
import com.hongyuan.coach.ui.course.activity.CourseDetailsActivity;
import com.hongyuan.coach.ui.course.beans.MyCourseBeans;

public class CourseItemViewModel extends ItemViewModel<CustomViewModel> {

    public ObservableField<MyCourseBeans.ListBean> entity = new ObservableField<>();

    public CourseItemViewModel(@NonNull CustomViewModel viewModel, MyCourseBeans.ListBean bean) {
        super(viewModel);
        entity.set(bean);
    }

    //改变选中的门店
    public BindingCommand goDetails = new BindingCommand(() -> {
        Bundle bundle = new Bundle();
        bundle.putString("cp_id",String.valueOf(entity.get().getCp_id()));
        viewModel.startActivity(CourseDetailsActivity.class,bundle);
    });
}
